/*
 * Step.java
 *
 * Created on 22 de abril de 2006, 10:55
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package usecase;

/**
 * Implementation of IStep interface.
 * @author Rincew
 */
public class Step 
    implements IStep
{
    
    //--- Attributtes ------------------------
    String id;
    String performedBy;
    String description;
    boolean isFinal;
    int type;
    
    //--- Attributtes for alternative steps --
    String condition;
    String action;
    String conclution;
    
    /** Creates a new instance of Step */
    public Step () {
        this.condition = "Not an alternative step";
        this.action = "";
        this.conclution = "";
    }

    public String getId () {
        return this.id;
    }
    
    public void setId(String id) {
        this.id = id;
    }

    /** **/
    public String getDescription () {
        return this.description;
    }
    public void setDescription(String d) {
        this.description = d.trim ();
    }

    /** **/
    public String getParticipant(){
        return this.performedBy;
    }
    public void setParticipant(String p) {
        this.performedBy = p;
    }

    /** **/
    public boolean isFinal () {
        return false;
    }

    /** This is unuseful due we have several iterator to
     * traverse all main step, all pre steps and all inv steps **/
    public int getType () {
        return this.type;
    }
    public void setType(int type) {
        this.type = type;
    } 

    /** **/
    public String getCondition () {
        return this.condition;
    }
    public void setCondition (String c) {
        this.condition = c;
    }


    /** **/
    public String getAction () {
        return this.action;
    }
    public void setAction (String c) {
        this.action = c;
    }

    /** **/
    public String getConclution () {
        return this.conclution;
    }
    public void setConclution (String c) {
        this.conclution = c;
    }
    public boolean hasConclution() {
        return this.conclution.compareTo ("") != 0;
    }

    
    
    /** For testing **/
    public String toString() {
        return this.id + ": " + "<<" + this.performedBy + ">>" +
            this.description + " / " + this.condition
            + " -> " + this.action + " -> " + this.conclution;
    }



}
